package crm.view.tree.verwaltung;

import java.awt.Component;

import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;

import crm.model.teacherPC.Manager;
import crm.model.teacherPC.net.StudentPC;



public class StudentTreeRender extends DefaultTreeCellRenderer {
	@Override
	public Component getTreeCellRendererComponent(JTree tree, Object value,
													boolean sel, boolean expanded, boolean leaf, int row,
													boolean hasFocus) {
		Component c =  super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
		if (value instanceof Manager){
			setText("PC");
		}else if (value instanceof StudentPC){
			setText(((StudentPC)value).getUser());
		}
		return this;
	}
}
